import 'package:day3pm/imgBox.dart';
import 'package:flutter/material.dart';

class EnlargeImage extends StatelessWidget {
  const EnlargeImage(
      {Key? key,
      required this.imgString,
      required this.title,
      required this.tag});

  final String imgString;
  final String title;
  final String tag;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: GestureDetector(
        onTap: () {
          Navigator.pop(context);
        },
        child: imgBox(
          width: double.infinity,
          height: double.infinity,
          color: Colors.transparent,
          title: title,
          imgString: imgString,
          tag: tag,
        ),
      ),
    );
  }
}

class EnlargeImageReturn extends StatelessWidget {
  const EnlargeImageReturn({super.key, required this.imgString});

  final String imgString;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Stack(
      children: [
        PhotosBox(
            width: double.infinity,
            height: double.infinity,
            imgString: imgString),
        GestureDetector(
          onTap: () {
            Navigator.pop(context);
          },
          child: Container(
            alignment: Alignment.topRight,
            margin: EdgeInsets.all(20),
            child: Text(
              '< Back',
              style: TextStyle(fontSize: 30, color: Colors.white),
            ),
          ),
        ),
      ],
    ));
  }
}
